#ifndef __HISTO_H__
#define __HISTO_H__

#include <iostream>
#include <map>
#include <fstream>
#include "dna.h"
using namespace std;

class Histogram{
private:
	// attributes
	map<int, int> _data;

private:
	// methods

public:
	Histogram(){}
	Histogram(DnaSeq * tabSeq, size_t size);	
	
	void writeData(string file);
	
	map<int,int> getMap() const {return _data;}
	
	bool operator==(const Histogram &h)
	{
		map<int,int> l = _data;
		map<int,int> r = h.getMap();
		
		if(l.size() != r.size())
			return false;
		
		map<int,int>::const_iterator i, j;
		
		for(i = l.begin(), j = r.begin(); i != l.end(); ++i, ++j)
		{
			if(*i != *j)
			  return false;
		}

    	return true;
	}

	Histogram & operator=(const Histogram & h)
	{
		_data.clear();
		map<int,int> m = h.getMap();
		_data.insert(m.begin(), m.end());
		return *this;
	}

};

#endif 
